<extend name="Base/common"/>
<block name="style">
   <style type="text/css">
    p{
        width: 90%;
        height: 45px;
        margin-left: 5%;
        margin-top:10px; 

    }
    p span{
        width: 30%;
        height: 45px;
        background: #EDEDED;
        border:1px solid #ccc;
        border-right: none;
        line-height: 45px;
        text-align: center;
        float: left;
    }
    p input{
        width: 65%;
        height: 45px;
        line-height: 45px;
        background: #fff;
        float: left;
        border:1px solid #ccc;
    }

    p button{
        /*width: 50%;*/
        /*height: 45px;*/
        /*margin-left:25%;*/
        margin-top:25%;
        /*background: #EDEDED;*/
        /*border:1px solid #ccc;*/
        text-align: center;
        /*float: left;*/
    }
    .span{
        float: left;
        width: 90%;
        text-indent: 2em;
        margin-left: 5%;
        margin-top: 4%;
        font-size: 13px;
        color: red;

    }


.layer-content {
    position: fixed;
    left: 0;
    /*top:50%;*/
    bottom: 0;
    width: 100%;
    height: auto;
    padding-bottom: 3px;
    z-index: 1000;
    background: #B0E2FF;
    display: none;
}   
.num{
    float: left;
    width:32%;
    background: #fff;
    height:45px;
    line-height: 45px;
    margin-right: 2%;
    margin-top: 3px;
    text-align: center;
    border-radius: 2px 2px;
    font-family: "宋体";
    font-weight: bolder;
}   
#remove{
    float: left;
    width:32%;
    height:45px;
    line-height: 45px;
    background: #fff;
    margin-top: 3px;
    text-align: center;
    border-radius: 2px 2px;
    font-family: "宋体";
    font-weight: bolder;

}  
#block{
    width:100%;
    height: 58%;
    position: fixed;
    top:0;
    background: rgba(0,0,0,0);
    display: none;

}

 .tips{
        position:fixed;
        top:0px;
        left:0px;
        background: rgba(41,81,196,0.5);
        width:100%;
        color:#fff;
        font-size:16px;
        text-align: left;
        text-indent: 2em;
        line-height:30px;
        z-index: 99;
    }


</style>
</block>
<block name="body">
    <div class="tips"></div>
   
    <form action="" method="post">
            <p>
                <span>支付宝账号</span>
                <input  name="alipay" value="{$list.alipay}" readonly="readonly"/>
                <input name='uid' type="hidden"  class="uid" value="{$list.uid}">
            </p>
            <p class="_money">
                <span>提现金额</span>
                <input name="money" class="money" readonly value="{$gather.money}" />

            </p>
            <p>  
                <button type="button"  class="weui-btn weui-btn_primary login-btn"  style="background: #EDEDED;color:#000;">提现</button>
                
            </p>
        </form>

        <span class="span">
            温馨提示：商户单笔提现最高5万元。
        </span>

        <if condition="$gather[frozen] eq 0">
            <span class="span">您的账户余额已被冻结，原因是：{$gather.frozen_cause} <a href="{:U('shensu')}&id={$list.shop_name}">我已处理完成>>></a></span>
        </if>


    <div id="block" > </div>
    <div class="layer-content">
        <p style="margin:0px;width:100%;text-align:center;font-size:14px;height:25px;line-height:25px;color:#000;font-family: "宋体";">创世·资金安全保驾护航</p>
        <div class="form_edit clearfix">
            <div class="num" style="margin-top:0px">1</div>
            <div class="num" style="margin-top:0px">2</div>
            <div class="num" style="float:right;margin-right:0px;margin-top:0px">3</div>
            <div class="num">4</div>
            <div class="num">5</div>
            <div class="num" style="float:right;margin-right:0px;">6</div>
            <div class="num">7</div>
            <div class="num">8</div>
            <div class="num" style="float:right;margin-right:0px;">9</div>
            <div class="num">.</div>
            <div class="num">0</div>
            <div id="remove" style="float:right;margin-right:0px;">Del</div>
        </div>
    </div>

</block>
<block name="script">
<script type="text/javascript">

$('.login-btn').click(function(){

    var data=$('form').serializeArray();
    $.ajax({
        type:'post',
        url:'',
        data:data,
        success:function(m){
            if(m==1){
                $('.tips').html('提现成功')
                $('.tips').show()
                setTimeout(function(){
                    $('.tips').hide()
                    location.href="{:U('Koubei/index')}"
                    
                },3000)
            }else{
                $('.tips').html(m)
                $('.tips').show()
                setTimeout(function(){
                    $('.tips').hide()
                },3000)
            }
        }
    })
})


$('._money').click(function(){
    var oDivHtml = $('.money').val();
    oDivHtml=parseFloat(oDivHtml)
    if(isNaN(oDivHtml)){
        $('.money').val('')
    }else{
        $('.money').val(oDivHtml)
        
    }

    $('.layer-content').show();
    $('#block').show();
})

$('#block').click(function(){
    $('.layer-content').hide();
    $('#block').hide();
})


$('.num').click(function(){
    var money = $('.money').val();

        if(money.indexOf('.')>-1&&$(this).text()=='.'){
            //已经有一个.
        }else{
            if(money.length==0&&$(this).text()=='.'){  
                $('.money').val('0.')//长度为0时输入.
            }else{
                if(money.indexOf('.')>-1&&money.indexOf('.')==(money.length-3)){

                }else{
                    money+=$(this).text()
                    $('.money').val(money)
                }

                
            }
            
        }
})
$('#remove').click(function(){
    var oDiv = $('.money');
    var oDivHtml = oDiv.val();    // alert(oDivHtml)
    oDiv.val(oDivHtml.substring(0,oDivHtml.length-1)) 
})


</script>

</block>